#include <QtWidgets/QApplication>
#include <QShortcut>
#include <qtreeview.h>
#include "MyTreeModel.h"
#include "MyTreeDelegate.h"

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);

	QTreeView view;

	MyTreeModel model;
	view.setModel(&model);
	view.resize(400, 400);
	view.show();

	view.setItemDelegate(new MyTreeDelegate);

	auto shortcut = new QShortcut(Qt::CTRL | Qt::Key_Q, &view);
	shortcut->setContext(Qt::ApplicationShortcut);
	QObject::connect(shortcut, &QShortcut::activated, qApp, QCoreApplication::quit);

	return a.exec();
}